package eventos;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;

class ComWindowAdapter extends JFrame {
ComWindowAdapter() {
this.setTitle("Usando um Window Adapter");
this.setSize(400, 400);
this.setVisible(true);
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
System.exit(0);
}
});

}
public static void main(String[] args) {
new ComWindowAdapter();
}
}
